<template>
    <div>
        <router-view/>
    </div>
</template>

<script>
    export default {
        name: "App",
        data() {
            return {
                text:'你好啊'
            };
        },
        created:function(){
            
            window.$vm = window.$vm || {};
            $vm.App = this;
            window.$fn = $vm.App.$fn
            if($vm.App.$router.history.current.path == '/' || $vm.App.$router.history.current.path == '/index'){
                this.$fn.isLogin((status)=>{
                    console.log(status);
                    if(status != 1){//当前未登陆
                        this.$router.push({path:'/login'})//跳转到登陆页面
                        return;
                    }
                    this.$router.push({path:'/index'})//跳转到聊天页面
                });
            }
        }
    };
</script>

<style>
    @import url(./css/style.css);
</style>
